#include <iostream>
#include <assert.h>
#include <map>
#include <string>
#include "asyncqueue.h"

int main()
{
    CAsyncQueue<std::string, bool> sqlQueue;
	sqlQueue.Start(1, [](const std::string& sql) {
		std::cout << sql << std::endl;
		return true;
	});

	sqlQueue.Push("select * from db;");
	auto ret = sqlQueue.Push("delete from db;");
	if (ret.get())
	{
		std::cout << "执行成功" << std::endl;
	}

	std::this_thread::sleep_for(std::chrono::milliseconds(5000));
    return 0;
}